package com.enjoy.aop.dynamicProxy.cglib;

import org.springframework.cglib.proxy.CallbackFilter;

import java.lang.reflect.Method;

public class CglibCallbackFilter implements CallbackFilter {
    @Override
    public int accept(Method method) {
        if ("sayHello".equals(method.getName())) {
            return 0;
        } else if ("sayEat".equals(method.getName())) {
            return 1;
        } else {
            return 2;
        }
    }
}
